package com.lky.marshallmall.product.feign;

import com.lky.common.to.SkuReductionTo;
import com.lky.common.to.SpuBoundsTo;
import com.lky.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by
 * autor : Marshall lky
 * datetime: 2021/3/21 22:29
 */
@FeignClient("mall-coupon")
public interface CouponFeignService {

    /**
     * springcloud会把对象参数，转为json（@RequestBody）
     * 对方服务收到请求，会将json装维对象。
     * 只要json数据模型事兼容的，双方服务无需使用同一个to。（一个to一个entity）
     * @param spuBoundsTo
     */
    @PostMapping("/coupon/spubounds/save")
    R saveSpuBounds(@RequestBody SpuBoundsTo spuBoundsTo);

    @PostMapping("/coupon/skufullreduction/saveinfo")
    R saveSkuReduction(@RequestBody SkuReductionTo skuReductionTo);
}
